<script>
	import Vue from 'vue';
	import { initData } from '@/common/data/dataModule.js';
	import { promiseTimeOut } from '@/common/util/util.js';
	export default {
		onLaunch: function () {
			console.log('App Launch');
			return new Promise((resolve) => {
				// 获取手机系统信息
				const info = uni.getSystemInfoSync();
				// console.debug('info', info);
				Vue.prototype.$StatusBarHeight = info.statusBarHeight || 36;
				Vue.prototype.$windowWidth = info.windowWidth;
				Vue.prototype.$windowHeight = info.windowHeight;
				Vue.prototype.$NavBarHeight = 48;
				// console.debug('plus',uni.getSystemInfoSync().safeAreaInsets);
				Vue.prototype.$ThemeColor = '#29b105';
				Vue.prototype.$subColor = '#156ab7';
				Vue.prototype.$dpi = info.devicePixelRatio;
				promiseTimeOut(initData(), 1000, 'initData').finally(() => {
					// #ifdef APP-PLUS
					setTimeout(() => {
						console.debug('关闭启动页');
						plus.navigator.closeSplashscreen();
						resolve();
					}, 1000);
					// #endif

					// #ifndef APP-PLUS
					resolve();
					// #endif

				});
			}).catch((e) => {});

		},
		onShow: function () {
			console.log('App Show');
		},
		onHide: function () {
			console.log('App Hide');
		}
	};
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";
	@import 'common/style/icons.css';
	@import 'common/style/page.scss';

	::-webkit-scrollbar {
		display: none;
		width: 0 !important;
		height: 0 !important;
		-webkit-appearance: none;
		background: transparent;
	}

	@import 'common/style/common.scss';
</style>
